package com.itxx.keyCase;

import java.time.LocalDateTime;

//在原基础上修改日期
public class NewDateWithDemo {
    public static void main(String[] args) {
        //创建一个LocalDateTime对象 l 并使用now()方法获取当前时间
        LocalDateTime l = LocalDateTime.now();
        System.out.println(l);
        //通过 With()方法在原基础上修改日期
        LocalDateTime withLocalDateTime = l.withYear(3).withMonth(1).withDayOfMonth(1).withMinute(1).withSecond(1);
        System.out.println(withLocalDateTime);

    }
}
